﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.Text;

namespace MySkiPatrolEntity
{
    // NOTE: You can use the "Rename" command on the "Refactor" menu to change the interface name "IMembership" in both code and config file together.
    [ServiceContract]
    public interface IMembership
    {
        [OperationContract]
        WebAccess Login(WebAccess data);

        [OperationContract]
        Member Logout(Member data);

        [OperationContract]
        Member GetMember(Member data);
    }

    [DataContract]
    public class IDCard
    {
        [DataMember]
        public string CardID { get; set; }
        [DataMember]
        public string MemberID { get; set; }
        [DataMember]
        public DateTimeOffset Expires { get; set; }
        [DataMember]
        public DateTimeOffset LastUsed { get; set; }
        [DataMember]
        public DateTimeOffset DateDeleted { get; set; }
        [DataMember]
        public bool IsDeleted { get; set; }
        [DataMember]
        public bool IsExpired { get; set; }

        [DataMember]
        public DataTransaction DataTransaction { get; set; }
    }

    [DataContract]
    public class Member
    {
        [DataMember]
        public Patrol Patrol { get; set; }
        [DataMember]
        public DataTransaction DataTransaction { get; set; }
        [DataMember]
        public string ID { get; set; }
        [DataMember]
        public string FirstName { get; set; }
        [DataMember]
        public string LastName { get; set; }
        [DataMember]
        public string FullName { get; set; }
        [DataMember]
        public string Username { get; set; }
        [DataMember]
        public string Password { get; set; }
        [DataMember]
        public string NSPNumber { get; set; }
        [DataMember]
        public string MiddleName { get; set; }
        [DataMember]
        public string Prefix { get; set; }
        [DataMember]
        public string Suffix { get; set; }
        [DataMember]
        public bool IsDeleted { get; set; }
        [DataMember]
        public DateTimeOffset DateDeleted { get; set; }
        //[DataMember]
        //public MemberLevel Level { get; set; }

        //[DataMember]
        //public EmailAddressCollection EmailAddressCollection { get; set; }

        [DataMember]
        public List<Group> Groups { get; set; }

        [DataMember]
        public List<Role> Roles { get; set; }

        //[DataMember]
        //public ServiceCounter ServiceCounter { get; set; }

        [DataMember]
        public List<IDCard> IDCards { get; set; }
    }

    [DataContract]
    public class WebAccess
    {
        [DataMember]
        public DataTransaction DataTransaction { get; set; }
        [DataMember]
        public string Username { get; set; }
        [DataMember]
        public string Password { get; set; }
        [DataMember]
        public string MemberID { get; set; }
    }

    [DataContract]
    public class Role
    {
        [DataMember]
        public DataTransaction DataTransaction { get; set; }
        [DataMember]
        public string ID { get; set; }
        [DataMember]
        public string Name { get; set; }
        [DataMember]
        public string Description { get; set; }

    }

    [DataContract]
    public class Group
    {
        [DataMember]
        public DataTransaction DataTransaction { get; set; }
        [DataMember]
        public string ID { get; set; }
        [DataMember]
        public string Name { get; set; }
        [DataMember]
        public string Description { get; set; }

    }
}
